import QtQuick 1.0

Rectangle {
    width: 360
    height: 640

    Text {
	id: title
	anchors.top: parent.top
	font.pointSize: 12
	height: 40
	width: parent.width
	horizontalAlignment: Text.AlignHCenter
	verticalAlignment: Text.AlignVCenter
	text: "Simple View Manager"
    }


    SimpleViewManager {
	id: myViewManager
	anchors.top: title.bottom
	anchors.bottom: parent.bottom
	anchors.left: parent.left
	anchors.right: parent.right

	Rectangle {
	    id: view1
	    color: "blue"
	    width:  parent.width
	    height: parent.height

	    Text {
		id: view1Text
		text: "Go to View 2"
		color: "white"
		anchors.centerIn: parent
	    }
	    MouseArea {
		anchors.fill: parent
		onClicked: view2.visible = true
	    }
	}
	Rectangle {
	    id: view2
	    color: "darkgreen"
	    width:  parent.width
	    height: parent.height

	    Text {
		id: view2Text
		text: "Go to View 3"
		color: "white"
		anchors.centerIn: parent
	    }
	    MouseArea {
		anchors.fill: parent
		onClicked: view3.visible = true
	    }
	}
	Rectangle {
	    id: view3
	    color: "darkgrey"
	    width:  parent.width
	    height: parent.height

	    Text {
		id: view3Text
		text: "Back to View 1"
		color: "white"
		anchors.centerIn: parent
	    }
	    MouseArea {
		anchors.fill: parent
		onClicked: view1.visible = true
	    }
	}
    }

    Image {
	    source: "close.png"
	    anchors.right: parent.right
	    anchors.bottom: parent.bottom
	    anchors.margins: 10

	    MouseArea {
		anchors.fill: parent
		onClicked: Qt.quit()
	    }
	}

}
